'use strict';
const request = require('request');


exports.visitSite = function(url) {
    return new Promise((resolve, reject) => {
        request(url, function(error, response, body) {
            if (error) {
                return reject(error);
            } else if (response.statusCode != 200) {
                return reject('request fail ' + response.statusCode);
            }
            resolve(response.body);
        })
    })
};